#-*- coding: utf8 -*-
from tutor.script import *
from tutor.plugin.maple import *

# variáveis úteis
half = M('1/2')
t = M.t
_i, _j, _k = M('_i, _j, _k')
rr = M('`..`')
coeff = M.coeff

# parâmetros iniciais
a = M(oneof(1, 2, 3, 4))
b = a + M(oneof(1, 2, 3, 4))
k = M(oneof(2, 3, 4, 5))
R = M(oneof(2, 3))
h = b - a

# campo
F = fieldF = (exp(z) * sin(x)) * _i + \
             (-exp(z) * y * cos(x)) * _j + \
             (M.sqrt(x ** 2 + y ** 2) * M.ln(k * z)) * _k
kz = k * z

# --- resultados --------------------------------------------------------------
print('campo: %s' % F)

# correto 
fluxo = 2 * Pi * M.ln(b / a) * R ** 3 / 3
print('fluxo: %s' % fluxo)

# erros
jacobiano = R ** 2 * Pi * M.ln(b / a)
print('jacobiano: %s' % jacobiano)

limites = 2 * Pi * M.ln(b) * R ** 3 / 3
print('limites: %s' % limites)

derivadaLn = 2 * Pi * k * M.ln(b / a) * R ** 3 / 3
print('derivadaLn: %s' % derivadaLn)

distrator1 = Pi * M.ln(b / a)
print('distrator1: %s' % distrator1)

distrator2 = Pi * k * M.ln(b / a) * R ** 2
print('distrator2: %s' % distrator2)

